package io.bitark.seqserver;

import io.bitark.seqserver.alg.Sequence;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class SeqServerApp {

	@SuppressWarnings("unused")
	public static void main(String[] args) {
		ApplicationContext context=SpringApplication.run(SeqServerApp.class, args);	
	}

    @Bean
    public Sequence sequence(@Value("${id.workerId}") long workerId, @Value("${id.dataCenterId}") long dataCenterId) {
        Sequence seq=new Sequence(workerId,dataCenterId);
        return seq;
    }

}
